var JSONxEdit_jsonStringForm_Samples = [
new Ext.Action({
	text: 'Beispiel 1',
	handler: function() {
		Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue(
			'{\n'+
			'"test":"test2"\n'+
			'}'
			);
	}
}),
new Ext.Action({
	text: 'Beispiel 2',
	handler: function() {
		Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue('{\n\t"Kreditkarte": "Xema",\n\t"Nummer": "1234-5678-9012-3456",\n\t"Inhaber": {\n\t\t"Name": "Reich",\n\t\t"Vorname": "Rainer",\n\t\t"Geschlecht": "männlich",\n\t\t"Vorlieben": [ "Reiten", "Schwimmen", "Lesen" ],\n\t\t"Alter": null\n\t},\n\t"Deckung": 2e+6,\n\t"Währung": "EURO"\n}');
	}
}),
new Ext.Action({
	text: 'Beispiel 3',
	handler: function() {
		Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue('{\n\tfirstName: "christopher",\n\tlastName: "S.",\n\tchildren: [\n\t\t{\n\t\t\tname: "Markus",\n\t\t\tage: 10\n\t\t},\n\t\t{\n\t\t\tname: "Michael",\n\t\t\tage: 8\n\t\t}\n\t]\n}');
	}
})
];



var JSONxEdit_jsonStringForm_menu_file = [
{
	text: 'Neu',
	handler: function() {
		disableEditor();
		setTreeDefaultRootNode();

		Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue('');
	}
},
{
	text: 'Beenden',
	handler: quitApplication
}
];

var JSONxEdit_jsonStringForm_menu_edit = [
/*{
	text: 'Ausschneiden',
	disabled: true,
	handler: function() {

	}
},{
	text: 'Kopieren',
	disabled: true,
	handler: function() {

	}
},{
	text: 'Einfügen',
	disabled: true,
	handler: function() {

	}
},
'-',*/
{
	text: 'JSON Kopieren',
	handler: function() {
		copyToClipboard ( Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").getValue() );
	}
},{
	text: 'JSON Einfügen',
	handler: function() {
		Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue( getFromClipboard () );
	}
}
];

var JSONxEdit_jsonStringForm_toolbar_menu = new Ext.Toolbar({
	items:[{
		text: 'Datei',
		menu: JSONxEdit_jsonStringForm_menu_file
	},{
		text: 'Bearbeiten',
		menu: JSONxEdit_jsonStringForm_menu_edit
	}]
});

var JSONxEdit_jsonStringForm_toolbar_tb = new Ext.Toolbar({
	items:[{
		id: 'btn_loadToTree',
		iconCls: "icon_loadToTree",
		scale: 'large',
		handler: saveJsonStringToTree
	},{
		id: 'btn_loadFromTree',
		iconCls: "icon_loadFromTree",
		scale: 'large',
		handler: saveTreeToJsonString
	},
	'-',{
		id: 'btn_copyJson',
		iconCls: "icon_copyJson",
		scale: 'large',
		handler: function() {
			copyToClipboard ( Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").getValue() );
		}
	},{
		id: 'btn_pasteJson',
		iconCls: "icon_pasteJson",
		scale: 'large',
		handler: function() {
			Ext.getCmp("JSONxEdit_FormPanel_TextArea_jsonString").setValue( getFromClipboard () );
		}
	},
	'-'
	,{
		id: 'btn_jsonSamples',
		text: 'Samples',
		scale: 'large',
		menu: JSONxEdit_jsonStringForm_Samples
	}],
	listeners: {
		'afterlayout': {
			fn: function(p){
				
			},
			single: true // important, as many layouts can occur
		}
	}
});

var JSONxEdit_jsonStringForm_toolbar = new Ext.Toolbar({
	items:[
	JSONxEdit_jsonStringForm_toolbar_menu,
	JSONxEdit_jsonStringForm_toolbar_tb
	],
	cls: 'parentToolbar',
	layout: 'anchor'
});